<?php
/**
 * Created by PhpStorm.
 * User: dell913
 * Date: 2019/4/5
 * Time: 17:34
 */

namespace app\common\model;

use think\Model;

class Admin extends Model
{
    const ADMIN_GROUPS = [
       1 => '超管',
       2 => '管理员',
       3 => '核销员',
    ];

    protected $table = 'tb_admin';

    protected $pk = 'id';

    protected $autoWriteTimestamp = 'int';

    protected $createTime = 'create_tm';

//    protected $updateTime = 'update_tm';

    public function getGroupNameAttr()
    {
        $group = $this->getData('group');

        return self::ADMIN_GROUPS[$group];
    }
}
